﻿Maiks_AR = LibStub("AceAddon-3.0"):NewAddon("Maiks_AR", "AceConsole-3.0", "AceEvent-3.0" );

function Maiks_AR:OnInitialize()
    -- Called when the addon is loaded
	self.db = LibStub("AceDB-3.0"):New("Maiks_ARdb", defaults, "Default")
	LibStub("AceConfig-3.0"):RegisterOptionsTable("Maiks_AR", Maiks_AR:createoptions())
    self.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("Maiks_AR", "Maiks: AR", "Maiks")

    Maiks_AR:RegisterEvent('CHAT_MSG_RAID', "CHAT_MSG")
    Maiks_AR:RegisterEvent('CHAT_MSG_BATTLEGROUND', "CHAT_MSG")
    Maiks_AR:RegisterEvent('CHAT_MSG_BATTLEGROUND_LEADER', "CHAT_MSG")
    Maiks_AR:RegisterEvent('CHAT_MSG_CHANNEL', "CHAT_MSG")
    Maiks_AR:RegisterEvent('CHAT_MSG_GUILD', "CHAT_MSG")
    Maiks_AR:RegisterEvent('CHAT_MSG_OFFICER', "CHAT_MSG")
    Maiks_AR:RegisterEvent('CHAT_MSG_PARTY', "CHAT_MSG")
    Maiks_AR:RegisterEvent('CHAT_MSG_PARTY_LEADER', "CHAT_MSG")
    Maiks_AR:RegisterEvent('CHAT_MSG_RAID_LEADER', "CHAT_MSG")
    Maiks_AR:RegisterEvent('CHAT_MSG_RAID_WARNING', "CHAT_MSG")
    Maiks_AR:RegisterEvent('CHAT_MSG_SAY', "CHAT_MSG")
    Maiks_AR:RegisterEvent('CHAT_MSG_WHISPER', "CHAT_MSG")
    Maiks_AR:RegisterEvent('CHAT_MSG_YELL', "CHAT_MSG")
    Maiks_AR:RegisterEvent('CHAT_MSG_BN_WHISPER')
	
	if Maiks_ARdb.options == nil then 
		Maiks_ARdb.options = {}
		Maiks_ARdb.input = {}
		Maiks_ARdb.output = {}
		for i=1,50 do
			Maiks_ARdb.options[i] = {
				["CHAT_MSG_RAID"] = false,
				["CHAT_MSG_BATTLEGROUND"] = false,
				["CHAT_MSG_BATTLEGROUND_LEADER"] = false,
				["CHAT_MSG_BN_WHISPER"] = false,
				["CHAT_MSG_CHANNEL"] = false,
				["CHAT_MSG_GUILD"] = false,
				["CHAT_MSG_OFFICER"] = false,
				["CHAT_MSG_PARTY"] = false,
				["CHAT_MSG_PARTY_LEADER"] = false,
				["CHAT_MSG_RAID_LEADER"] = false,
				["CHAT_MSG_RAID_WARNING"] = false,
				["CHAT_MSG_SAY"] = false,
				["CHAT_MSG_WHISPER"] = false,
				["CHAT_MSG_YELL"] = false,
			}
			Maiks_ARdb.input[i] = ""
			Maiks_ARdb.output[i] = ""
		end
	end	
end

function Maiks_AR:OnEnable()
    -- Called when the addon is enabled
end

function Maiks_AR:OnDisable()
    -- Called when the addon is disabled
end

function Maiks_AR:createoptions()
	options = {
		name = "Maiks:AR",
		handler = Maiks_AR,
		type = "group",
		childGroups = "tab",
		args = {
			optionsgroup= {
				name = "Options",
				type = "group",
				order = 1,
		        args = {
					desc1 = {
						name = "Options for Maiks:AR\n\n\nFirst of all this options panel can be a bit slow, this is nornal it is a really big options panel.\n\nIn Message make sure your message does not exceed 254 characters. If you need to make a bigger text or for a summory press the 'return' key to sent a new message with the same trigger. You can do this up to 50 times but i do not advice to do so many. You could be reported for spamming.",
						type = "description",
						order = 1.1,
					},
					header1 = {
						name = "Option 1",
						type = "header",
						order = 1.2,
					},
					input1 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 1.3,
						get = function() return Maiks_AR:input("get", 1) end,
						set = function(info, arg) Maiks_AR:input("set", 1, arg) end,
						multiline = false,
						width = "full",
					},
					output1 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 1.4,
						get = function() return Maiks_AR:output("get", 1) end,
						set = function(info, arg) Maiks_AR:output("set", 1, arg) end,
						multiline = true,
						width = "full",
					},
					channel1 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 1.5,
						get = function(info, channel) return Maiks_AR:channel("get", 1, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 1, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header2 = {
						name = "Option 2",
						type = "header",
						order = 2.1,
					},
					input2 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 2.2,
						get = function() return Maiks_AR:input("get", 2) end,
						set = function(info, arg) Maiks_AR:input("set", 2, arg) end,
						multiline = false,
						width = "full",
					},
					output2 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 2.3,
						get = function() return Maiks_AR:output("get", 2) end,
						set = function(info, arg) Maiks_AR:output("set", 2, arg) end,
						multiline = true,
						width = "full",
					},
					channel2 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 2.4,
						get = function(info, channel) return Maiks_AR:channel("get", 2, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 2, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header3 = {
						name = "Option 3",
						type = "header",
						order = 3.1,
					},
					input3 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 3.2,
						get = function() return Maiks_AR:input("get", 3) end,
						set = function(info, arg) Maiks_AR:input("set", 3, arg) end,
						multiline = false,
						width = "full",
					},
					output3 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 3.3,
						get = function() return Maiks_AR:output("get", 3) end,
						set = function(info, arg) Maiks_AR:output("set", 3, arg) end,
						multiline = true,
						width = "full",
					},
					channel3 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 3.4,
						get = function(info, channel) return Maiks_AR:channel("get", 3, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 3, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header4 = {
						name = "Option 4",
						type = "header",
						order = 4.1,
					},
					input4 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 4.2,
						get = function() return Maiks_AR:input("get", 4) end,
						set = function(info, arg) Maiks_AR:input("set", 4, arg) end,
						multiline = false,
						width = "full",
					},
					output4 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 4.3,
						get = function() return Maiks_AR:output("get", 4) end,
						set = function(info, arg) Maiks_AR:output("set", 4, arg) end,
						multiline = true,
						width = "full",
					},
					channel4 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 4.4,
						get = function(info, channel) return Maiks_AR:channel("get", 4, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 4, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header5 = {
						name = "Option 5",
						type = "header",
						order = 5.1,
					},
					input5 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 5.2,
						get = function() return Maiks_AR:input("get", 5) end,
						set = function(info, arg) Maiks_AR:input("set", 5, arg) end,
						multiline = false,
						width = "full",
					},
					output5 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 5.3,
						get = function() return Maiks_AR:output("get", 5) end,
						set = function(info, arg) Maiks_AR:output("set", 5, arg) end,
						multiline = true,
						width = "full",
					},
					channel5 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 5.4,
						get = function(info, channel) return Maiks_AR:channel("get", 5, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 5, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header6 = {
						name = "Option 6",
						type = "header",
						order = 6.1,
					},
					input6 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 6.2,
						get = function() return Maiks_AR:input("get", 6) end,
						set = function(info, arg) Maiks_AR:input("set", 6, arg) end,
						multiline = false,
						width = "full",
					},
					output6 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 6.3,
						get = function() return Maiks_AR:output("get", 6) end,
						set = function(info, arg) Maiks_AR:output("set", 6, arg) end,
						multiline = true,
						width = "full",
					},
					channel6 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 6.4,
						get = function(info, channel) return Maiks_AR:channel("get", 6, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 6, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header7 = {
						name = "Option 7",
						type = "header",
						order = 7.1,
					},
					input7 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 7.2,
						get = function() return Maiks_AR:input("get", 7) end,
						set = function(info, arg) Maiks_AR:input("set", 7, arg) end,
						multiline = false,
						width = "full",
					},
					output7 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 7.3,
						get = function() return Maiks_AR:output("get", 7) end,
						set = function(info, arg) Maiks_AR:output("set", 7, arg) end,
						multiline = true,
						width = "full",
					},
					channel7 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 7.4,
						get = function(info, channel) return Maiks_AR:channel("get", 7, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 7, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header8 = {
						name = "Option 8",
						type = "header",
						order = 8.1,
					},
					input8 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 8.2,
						get = function() return Maiks_AR:input("get", 8) end,
						set = function(info, arg) Maiks_AR:input("set", 8, arg) end,
						multiline = false,
						width = "full",
					},
					output8 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 8.3,
						get = function() return Maiks_AR:output("get", 8) end,
						set = function(info, arg) Maiks_AR:output("set", 8, arg) end,
						multiline = true,
						width = "full",
					},
					channel8 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 8.4,
						get = function(info, channel) return Maiks_AR:channel("get", 8, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 8, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header9 = {
						name = "Option 9",
						type = "header",
						order = 9.1,
					},
					input9 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 9.2,
						get = function() return Maiks_AR:input("get", 9) end,
						set = function(info, arg) Maiks_AR:input("set", 9, arg) end,
						multiline = false,
						width = "full",
					},
					output9 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 9.3,
						get = function() return Maiks_AR:output("get", 9) end,
						set = function(info, arg) Maiks_AR:output("set", 9, arg) end,
						multiline = true,
						width = "full",
					},
					channel9 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 9.4,
						get = function(info, channel) return Maiks_AR:channel("get", 9, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 9, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header10 = {
						name = "Option 10",
						type = "header",
						order = 10.1,
					},
					input10 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 10.2,
						get = function() return Maiks_AR:input("get", 10) end,
						set = function(info, arg) Maiks_AR:input("set", 10, arg) end,
						multiline = false,
						width = "full",
					},
					output10 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 10.3,
						get = function() return Maiks_AR:output("get", 10) end,
						set = function(info, arg) Maiks_AR:output("set", 10, arg) end,
						multiline = true,
						width = "full",
					},
					channel10 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 10.4,
						get = function(info, channel) return Maiks_AR:channel("get", 10, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 10, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header11 = {
						name = "Option 11",
						type = "header",
						order = 11.1,
					},
					input11 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 11.2,
						get = function() return Maiks_AR:input("get", 11) end,
						set = function(info, arg) Maiks_AR:input("set", 11, arg) end,
						multiline = false,
						width = "full",
					},
					output11 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 11.3,
						get = function() return Maiks_AR:output("get", 11) end,
						set = function(info, arg) Maiks_AR:output("set", 11, arg) end,
						multiline = true,
						width = "full",
					},
					channel11 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 11.4,
						get = function(info, channel) return Maiks_AR:channel("get", 11, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 11, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header12 = {
						name = "Option 12",
						type = "header",
						order = 12.1,
					},
					input12 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 12.2,
						get = function() return Maiks_AR:input("get", 12) end,
						set = function(info, arg) Maiks_AR:input("set", 12, arg) end,
						multiline = false,
						width = "full",
					},
					output12 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 12.3,
						get = function() return Maiks_AR:output("get", 12) end,
						set = function(info, arg) Maiks_AR:output("set", 12, arg) end,
						multiline = true,
						width = "full",
					},
					channel12 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 12.4,
						get = function(info, channel) return Maiks_AR:channel("get", 12, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 12, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header13 = {
						name = "Option 13",
						type = "header",
						order = 13.1,
					},
					input13 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 13.2,
						get = function() return Maiks_AR:input("get", 13) end,
						set = function(info, arg) Maiks_AR:input("set", 13, arg) end,
						multiline = false,
						width = "full",
					},
					output13 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 13.3,
						get = function() return Maiks_AR:output("get", 13) end,
						set = function(info, arg) Maiks_AR:output("set", 13, arg) end,
						multiline = true,
						width = "full",
					},
					channel13 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 13.4,
						get = function(info, channel) return Maiks_AR:channel("get", 13, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 13, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header14 = {
						name = "Option 14",
						type = "header",
						order = 14.1,
					},
					input14 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 14.2,
						get = function() return Maiks_AR:input("get", 14) end,
						set = function(info, arg) Maiks_AR:input("set", 14, arg) end,
						multiline = false,
						width = "full",
					},
					output14 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 14.3,
						get = function() return Maiks_AR:output("get", 14) end,
						set = function(info, arg) Maiks_AR:output("set", 14, arg) end,
						multiline = true,
						width = "full",
					},
					channel14 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 14.4,
						get = function(info, channel) return Maiks_AR:channel("get", 14, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 14, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header15 = {
						name = "Option 15",
						type = "header",
						order = 15.1,
					},
					input15 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 15.2,
						get = function() return Maiks_AR:input("get", 15) end,
						set = function(info, arg) Maiks_AR:input("set", 15, arg) end,
						multiline = false,
						width = "full",
					},
					output15 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 15.3,
						get = function() return Maiks_AR:output("get", 15) end,
						set = function(info, arg) Maiks_AR:output("set", 15, arg) end,
						multiline = true,
						width = "full",
					},
					channel15 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 15.4,
						get = function(info, channel) return Maiks_AR:channel("get", 15, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 15, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header16 = {
						name = "Option 16",
						type = "header",
						order = 16.1,
					},
					input16 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 16.2,
						get = function() return Maiks_AR:input("get", 16) end,
						set = function(info, arg) Maiks_AR:input("set", 16, arg) end,
						multiline = false,
						width = "full",
					},
					output16 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 16.3,
						get = function() return Maiks_AR:output("get", 16) end,
						set = function(info, arg) Maiks_AR:output("set", 16, arg) end,
						multiline = true,
						width = "full",
					},
					channel16 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 16.4,
						get = function(info, channel) return Maiks_AR:channel("get", 16, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 16, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header17 = {
						name = "Option 17",
						type = "header",
						order = 17.1,
					},
					input17 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 17.2,
						get = function() return Maiks_AR:input("get", 17) end,
						set = function(info, arg) Maiks_AR:input("set", 17, arg) end,
						multiline = false,
						width = "full",
					},
					output17 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 17.3,
						get = function() return Maiks_AR:output("get", 17) end,
						set = function(info, arg) Maiks_AR:output("set", 17, arg) end,
						multiline = true,
						width = "full",
					},
					channel17 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 17.4,
						get = function(info, channel) return Maiks_AR:channel("get", 17, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 17, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header18 = {
						name = "Option 18",
						type = "header",
						order = 18.1,
					},
					input18 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 18.2,
						get = function() return Maiks_AR:input("get", 18) end,
						set = function(info, arg) Maiks_AR:input("set", 18, arg) end,
						multiline = false,
						width = "full",
					},
					output18 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 18.3,
						get = function() return Maiks_AR:output("get", 18) end,
						set = function(info, arg) Maiks_AR:output("set", 18, arg) end,
						multiline = true,
						width = "full",
					},
					channel18 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 18.4,
						get = function(info, channel) return Maiks_AR:channel("get", 18, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 18, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header19 = {
						name = "Option 19",
						type = "header",
						order = 19.1,
					},
					input19 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 19.2,
						get = function() return Maiks_AR:input("get", 19) end,
						set = function(info, arg) Maiks_AR:input("set", 19, arg) end,
						multiline = false,
						width = "full",
					},
					output19 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 19.3,
						get = function() return Maiks_AR:output("get", 19) end,
						set = function(info, arg) Maiks_AR:output("set", 19, arg) end,
						multiline = true,
						width = "full",
					},
					channel19 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 19.4,
						get = function(info, channel) return Maiks_AR:channel("get", 19, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 19, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header20 = {
						name = "Option 20",
						type = "header",
						order = 20.1,
					},
					input20 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 20.2,
						get = function() return Maiks_AR:input("get", 20) end,
						set = function(info, arg) Maiks_AR:input("set", 20, arg) end,
						multiline = false,
						width = "full",
					},
					output20 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 20.3,
						get = function() return Maiks_AR:output("get", 20) end,
						set = function(info, arg) Maiks_AR:output("set", 20, arg) end,
						multiline = true,
						width = "full",
					},
					channel20 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 20.4,
						get = function(info, channel) return Maiks_AR:channel("get", 20, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 20, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header21 = {
						name = "Option 21",
						type = "header",
						order = 21.1,
					},
					input21 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 21.2,
						get = function() return Maiks_AR:input("get", 21) end,
						set = function(info, arg) Maiks_AR:input("set", 21, arg) end,
						multiline = false,
						width = "full",
					},
					output21 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 21.3,
						get = function() return Maiks_AR:output("get", 21) end,
						set = function(info, arg) Maiks_AR:output("set", 21, arg) end,
						multiline = true,
						width = "full",
					},
					channel21 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 21.4,
						get = function(info, channel) return Maiks_AR:channel("get", 21, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 21, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header22 = {
						name = "Option 22",
						type = "header",
						order = 22.1,
					},
					input22 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 22.2,
						get = function() return Maiks_AR:input("get", 22) end,
						set = function(info, arg) Maiks_AR:input("set", 22, arg) end,
						multiline = false,
						width = "full",
					},
					output22 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 22.3,
						get = function() return Maiks_AR:output("get", 22) end,
						set = function(info, arg) Maiks_AR:output("set", 22, arg) end,
						multiline = true,
						width = "full",
					},
					channel22 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 22.4,
						get = function(info, channel) return Maiks_AR:channel("get", 22, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 22, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header23 = {
						name = "Option 23",
						type = "header",
						order = 23.1,
					},
					input23 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 23.2,
						get = function() return Maiks_AR:input("get", 23) end,
						set = function(info, arg) Maiks_AR:input("set", 23, arg) end,
						multiline = false,
						width = "full",
					},
					output23 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 23.3,
						get = function() return Maiks_AR:output("get", 23) end,
						set = function(info, arg) Maiks_AR:output("set", 23, arg) end,
						multiline = true,
						width = "full",
					},
					channel23 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 23.4,
						get = function(info, channel) return Maiks_AR:channel("get", 23, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 23, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header24 = {
						name = "Option 24",
						type = "header",
						order = 24.1,
					},
					input24 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 24.2,
						get = function() return Maiks_AR:input("get", 24) end,
						set = function(info, arg) Maiks_AR:input("set", 24, arg) end,
						multiline = false,
						width = "full",
					},
					output24 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 24.3,
						get = function() return Maiks_AR:output("get", 24) end,
						set = function(info, arg) Maiks_AR:output("set", 24, arg) end,
						multiline = true,
						width = "full",
					},
					channel24 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 24.4,
						get = function(info, channel) return Maiks_AR:channel("get", 24, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 24, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header25 = {
						name = "Option 25",
						type = "header",
						order = 25.1,
					},
					input25 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 25.2,
						get = function() return Maiks_AR:input("get", 25) end,
						set = function(info, arg) Maiks_AR:input("set", 25, arg) end,
						multiline = false,
						width = "full",
					},
					output25 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 25.3,
						get = function() return Maiks_AR:output("get", 25) end,
						set = function(info, arg) Maiks_AR:output("set", 25, arg) end,
						multiline = true,
						width = "full",
					},
					channel25 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 25.4,
						get = function(info, channel) return Maiks_AR:channel("get", 25, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 25, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header26 = {
						name = "Option 26",
						type = "header",
						order = 26.1,
					},
					input26 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 26.2,
						get = function() return Maiks_AR:input("get", 26) end,
						set = function(info, arg) Maiks_AR:input("set", 26, arg) end,
						multiline = false,
						width = "full",
					},
					output26 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 26.3,
						get = function() return Maiks_AR:output("get", 26) end,
						set = function(info, arg) Maiks_AR:output("set", 26, arg) end,
						multiline = true,
						width = "full",
					},
					channel26 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 26.4,
						get = function(info, channel) return Maiks_AR:channel("get", 26, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 26, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header27 = {
						name = "Option 27",
						type = "header",
						order = 27.1,
					},
					input27 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 27.2,
						get = function() return Maiks_AR:input("get", 27) end,
						set = function(info, arg) Maiks_AR:input("set", 27, arg) end,
						multiline = false,
						width = "full",
					},
					output27 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 27.3,
						get = function() return Maiks_AR:output("get", 27) end,
						set = function(info, arg) Maiks_AR:output("set", 27, arg) end,
						multiline = true,
						width = "full",
					},
					channel27 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 27.4,
						get = function(info, channel) return Maiks_AR:channel("get", 27, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 27, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header28 = {
						name = "Option 28",
						type = "header",
						order = 28.1,
					},
					input28 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 28.2,
						get = function() return Maiks_AR:input("get", 28) end,
						set = function(info, arg) Maiks_AR:input("set", 28, arg) end,
						multiline = false,
						width = "full",
					},
					output28 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 28.3,
						get = function() return Maiks_AR:output("get", 28) end,
						set = function(info, arg) Maiks_AR:output("set", 28, arg) end,
						multiline = true,
						width = "full",
					},
					channel28 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 28.4,
						get = function(info, channel) return Maiks_AR:channel("get", 28, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 28, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header29 = {
						name = "Option 29",
						type = "header",
						order = 29.1,
					},
					input29 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 29.2,
						get = function() return Maiks_AR:input("get", 29) end,
						set = function(info, arg) Maiks_AR:input("set", 29, arg) end,
						multiline = false,
						width = "full",
					},
					output29 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 29.3,
						get = function() return Maiks_AR:output("get", 29) end,
						set = function(info, arg) Maiks_AR:output("set", 29, arg) end,
						multiline = true,
						width = "full",
					},
					channel29 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 29.4,
						get = function(info, channel) return Maiks_AR:channel("get", 29, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 29, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header30 = {
						name = "Option 30",
						type = "header",
						order = 30.1,
					},
					input30 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 30.2,
						get = function() return Maiks_AR:input("get", 30) end,
						set = function(info, arg) Maiks_AR:input("set", 30, arg) end,
						multiline = false,
						width = "full",
					},
					output30 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 30.3,
						get = function() return Maiks_AR:output("get", 30) end,
						set = function(info, arg) Maiks_AR:output("set", 30, arg) end,
						multiline = true,
						width = "full",
					},
					channel30 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 30.4,
						get = function(info, channel) return Maiks_AR:channel("get", 30, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 30, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header31 = {
						name = "Option 31",
						type = "header",
						order = 31.1,
					},
					input31 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 31.2,
						get = function() return Maiks_AR:input("get", 31) end,
						set = function(info, arg) Maiks_AR:input("set", 31, arg) end,
						multiline = false,
						width = "full",
					},
					output31 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 31.3,
						get = function() return Maiks_AR:output("get", 31) end,
						set = function(info, arg) Maiks_AR:output("set", 31, arg) end,
						multiline = true,
						width = "full",
					},
					channel31 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 31.4,
						get = function(info, channel) return Maiks_AR:channel("get", 31, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 31, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header32 = {
						name = "Option 32",
						type = "header",
						order = 32.1,
					},
					input32 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 32.2,
						get = function() return Maiks_AR:input("get", 32) end,
						set = function(info, arg) Maiks_AR:input("set", 32, arg) end,
						multiline = false,
						width = "full",
					},
					output32 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 32.3,
						get = function() return Maiks_AR:output("get", 32) end,
						set = function(info, arg) Maiks_AR:output("set", 32, arg) end,
						multiline = true,
						width = "full",
					},
					channel32 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 32.4,
						get = function(info, channel) return Maiks_AR:channel("get", 32, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 32, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header33 = {
						name = "Option 33",
						type = "header",
						order = 33.1,
					},
					input33 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 33.2,
						get = function() return Maiks_AR:input("get", 33) end,
						set = function(info, arg) Maiks_AR:input("set", 33, arg) end,
						multiline = false,
						width = "full",
					},
					output33 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 33.3,
						get = function() return Maiks_AR:output("get", 33) end,
						set = function(info, arg) Maiks_AR:output("set", 33, arg) end,
						multiline = true,
						width = "full",
					},
					channel33 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 33.4,
						get = function(info, channel) return Maiks_AR:channel("get", 33, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 33, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header34 = {
						name = "Option 34",
						type = "header",
						order = 34.1,
					},
					input34 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 34.2,
						get = function() return Maiks_AR:input("get", 34) end,
						set = function(info, arg) Maiks_AR:input("set", 34, arg) end,
						multiline = false,
						width = "full",
					},
					output34 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 34.3,
						get = function() return Maiks_AR:output("get", 34) end,
						set = function(info, arg) Maiks_AR:output("set", 34, arg) end,
						multiline = true,
						width = "full",
					},
					channel34 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 34.4,
						get = function(info, channel) return Maiks_AR:channel("get", 34, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 34, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header35 = {
						name = "Option 35",
						type = "header",
						order = 35.1,
					},
					input35 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 35.2,
						get = function() return Maiks_AR:input("get", 35) end,
						set = function(info, arg) Maiks_AR:input("set", 35, arg) end,
						multiline = false,
						width = "full",
					},
					output35 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 35.3,
						get = function() return Maiks_AR:output("get", 35) end,
						set = function(info, arg) Maiks_AR:output("set", 35, arg) end,
						multiline = true,
						width = "full",
					},
					channel35 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 35.4,
						get = function(info, channel) return Maiks_AR:channel("get", 35, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 35, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header36 = {
						name = "Option 36",
						type = "header",
						order = 36.1,
					},
					input36 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 36.2,
						get = function() return Maiks_AR:input("get", 36) end,
						set = function(info, arg) Maiks_AR:input("set", 36, arg) end,
						multiline = false,
						width = "full",
					},
					output36 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 36.3,
						get = function() return Maiks_AR:output("get", 36) end,
						set = function(info, arg) Maiks_AR:output("set", 36, arg) end,
						multiline = true,
						width = "full",
					},
					channel36 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 36.4,
						get = function(info, channel) return Maiks_AR:channel("get", 36, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 36, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header37 = {
						name = "Option 37",
						type = "header",
						order = 37.1,
					},
					input37 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 37.2,
						get = function() return Maiks_AR:input("get", 37) end,
						set = function(info, arg) Maiks_AR:input("set", 37, arg) end,
						multiline = false,
						width = "full",
					},
					output37 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 37.3,
						get = function() return Maiks_AR:output("get", 37) end,
						set = function(info, arg) Maiks_AR:output("set", 37, arg) end,
						multiline = true,
						width = "full",
					},
					channel37 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 37.4,
						get = function(info, channel) return Maiks_AR:channel("get", 37, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 37, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header38 = {
						name = "Option 38",
						type = "header",
						order = 38.1,
					},
					input38 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 38.2,
						get = function() return Maiks_AR:input("get", 38) end,
						set = function(info, arg) Maiks_AR:input("set", 38, arg) end,
						multiline = false,
						width = "full",
					},
					output38 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 38.3,
						get = function() return Maiks_AR:output("get", 38) end,
						set = function(info, arg) Maiks_AR:output("set", 38, arg) end,
						multiline = true,
						width = "full",
					},
					channel38 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 38.4,
						get = function(info, channel) return Maiks_AR:channel("get", 38, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 38, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header39 = {
						name = "Option 39",
						type = "header",
						order = 39.1,
					},
					input39 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 39.2,
						get = function() return Maiks_AR:input("get", 39) end,
						set = function(info, arg) Maiks_AR:input("set", 39, arg) end,
						multiline = false,
						width = "full",
					},
					output39 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 39.3,
						get = function() return Maiks_AR:output("get", 39) end,
						set = function(info, arg) Maiks_AR:output("set", 39, arg) end,
						multiline = true,
						width = "full",
					},
					channel39 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 39.4,
						get = function(info, channel) return Maiks_AR:channel("get", 39, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 39, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header40 = {
						name = "Option 40",
						type = "header",
						order = 40.1,
					},
					input40 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 40.2,
						get = function() return Maiks_AR:input("get", 40) end,
						set = function(info, arg) Maiks_AR:input("set", 40, arg) end,
						multiline = false,
						width = "full",
					},
					output40 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 40.3,
						get = function() return Maiks_AR:output("get", 40) end,
						set = function(info, arg) Maiks_AR:output("set", 40, arg) end,
						multiline = true,
						width = "full",
					},
					channel40 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 40.4,
						get = function(info, channel) return Maiks_AR:channel("get", 40, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 40, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header41 = {
						name = "Option 41",
						type = "header",
						order = 41.1,
					},
					input41 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 41.2,
						get = function() return Maiks_AR:input("get", 41) end,
						set = function(info, arg) Maiks_AR:input("set", 41, arg) end,
						multiline = false,
						width = "full",
					},
					output41 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 41.3,
						get = function() return Maiks_AR:output("get", 41) end,
						set = function(info, arg) Maiks_AR:output("set", 41, arg) end,
						multiline = true,
						width = "full",
					},
					channel41 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 41.4,
						get = function(info, channel) return Maiks_AR:channel("get", 41, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 41, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header42 = {
						name = "Option 42",
						type = "header",
						order = 42.1,
					},
					input42 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 42.2,
						get = function() return Maiks_AR:input("get", 42) end,
						set = function(info, arg) Maiks_AR:input("set", 42, arg) end,
						multiline = false,
						width = "full",
					},
					output42 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 42.3,
						get = function() return Maiks_AR:output("get", 42) end,
						set = function(info, arg) Maiks_AR:output("set", 42, arg) end,
						multiline = true,
						width = "full",
					},
					channel42 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 42.4,
						get = function(info, channel) return Maiks_AR:channel("get", 42, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 42, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header43 = {
						name = "Option 43",
						type = "header",
						order = 43.1,
					},
					input43 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 43.2,
						get = function() return Maiks_AR:input("get", 43) end,
						set = function(info, arg) Maiks_AR:input("set", 43, arg) end,
						multiline = false,
						width = "full",
					},
					output43 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 43.3,
						get = function() return Maiks_AR:output("get", 43) end,
						set = function(info, arg) Maiks_AR:output("set", 43, arg) end,
						multiline = true,
						width = "full",
					},
					channel43 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 43.4,
						get = function(info, channel) return Maiks_AR:channel("get", 43, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 43, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header44 = {
						name = "Option 44",
						type = "header",
						order = 44.1,
					},
					input44 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 44.2,
						get = function() return Maiks_AR:input("get", 44) end,
						set = function(info, arg) Maiks_AR:input("set", 44, arg) end,
						multiline = false,
						width = "full",
					},
					output44 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 44.3,
						get = function() return Maiks_AR:output("get", 44) end,
						set = function(info, arg) Maiks_AR:output("set", 44, arg) end,
						multiline = true,
						width = "full",
					},
					channel44 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 44.4,
						get = function(info, channel) return Maiks_AR:channel("get", 44, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 44, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header45 = {
						name = "Option 45",
						type = "header",
						order = 45.1,
					},
					input45 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 45.2,
						get = function() return Maiks_AR:input("get", 45) end,
						set = function(info, arg) Maiks_AR:input("set", 45, arg) end,
						multiline = false,
						width = "full",
					},
					output45 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 45.3,
						get = function() return Maiks_AR:output("get", 45) end,
						set = function(info, arg) Maiks_AR:output("set", 45, arg) end,
						multiline = true,
						width = "full",
					},
					channel45 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 45.4,
						get = function(info, channel) return Maiks_AR:channel("get", 45, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 45, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header46 = {
						name = "Option 46",
						type = "header",
						order = 46.1,
					},
					input46 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 46.2,
						get = function() return Maiks_AR:input("get", 46) end,
						set = function(info, arg) Maiks_AR:input("set", 46, arg) end,
						multiline = false,
						width = "full",
					},
					output46 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 46.3,
						get = function() return Maiks_AR:output("get", 46) end,
						set = function(info, arg) Maiks_AR:output("set", 46, arg) end,
						multiline = true,
						width = "full",
					},
					channel46 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 46.4,
						get = function(info, channel) return Maiks_AR:channel("get", 46, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 46, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header47 = {
						name = "Option 47",
						type = "header",
						order = 47.1,
					},
					input47 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 47.2,
						get = function() return Maiks_AR:input("get", 47) end,
						set = function(info, arg) Maiks_AR:input("set", 47, arg) end,
						multiline = false,
						width = "full",
					},
					output47 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 47.3,
						get = function() return Maiks_AR:output("get", 47) end,
						set = function(info, arg) Maiks_AR:output("set", 47, arg) end,
						multiline = true,
						width = "full",
					},
					channel47 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 47.4,
						get = function(info, channel) return Maiks_AR:channel("get", 47, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 47, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header48 = {
						name = "Option 48",
						type = "header",
						order = 48.1,
					},
					input48 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 48.2,
						get = function() return Maiks_AR:input("get", 48) end,
						set = function(info, arg) Maiks_AR:input("set", 48, arg) end,
						multiline = false,
						width = "full",
					},
					output48 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 48.3,
						get = function() return Maiks_AR:output("get", 48) end,
						set = function(info, arg) Maiks_AR:output("set", 48, arg) end,
						multiline = true,
						width = "full",
					},
					channel48 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 48.4,
						get = function(info, channel) return Maiks_AR:channel("get", 48, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 48, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header49 = {
						name = "Option 49",
						type = "header",
						order = 49.1,
					},
					input49 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 49.2,
						get = function() return Maiks_AR:input("get", 49) end,
						set = function(info, arg) Maiks_AR:input("set", 49, arg) end,
						multiline = false,
						width = "full",
					},
					output49 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 49.3,
						get = function() return Maiks_AR:output("get", 49) end,
						set = function(info, arg) Maiks_AR:output("set", 49, arg) end,
						multiline = true,
						width = "full",
					},
					channel49 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 49.4,
						get = function(info, channel) return Maiks_AR:channel("get", 49, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 49, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
					header50 = {
						name = "Option 50",
						type = "header",
						order = 50.1,
					},
					input50 = {
						name = "Trigger",
						type = "input",
						desc = "What text should trigger the message?",
						order = 50.2,
						get = function() return Maiks_AR:input("get", 50) end,
						set = function(info, arg) Maiks_AR:input("set", 50, arg) end,
						multiline = false,
						width = "full",
					},
					output50 = {
						name = "Message",
						type = "input",
						desc = "What is the message?",
						order = 50.3,
						get = function() return Maiks_AR:output("get", 50) end,
						set = function(info, arg) Maiks_AR:output("set", 50, arg) end,
						multiline = true,
						width = "full",
					},
					channel50 = {
						name = "Channels",
						type = "multiselect",
						desc = "if unchecked the addon will not reply in that channel.\nif checked the addon will reply in that channel.\nif greyed the addon will reply in a whisper.",
						order = 50.4,
						get = function(info, channel) return Maiks_AR:channel("get", 50, channel) end,
						set = function(info, channel, state) Maiks_AR:channel("set", 50, channel, state) end,
						tristate = true,
						values = ChatChannels,
					},
				},
			},      
		},
	}

return options
end

function Maiks_AR:input(arg1, arg2, arg3)
	if arg1 == "set" then
		Maiks_ARdb.input[arg2] = arg3
	elseif arg1 == "get" then
		return Maiks_ARdb.input[arg2]
	end
end

function Maiks_AR:output(arg1, arg2, arg3)
	if arg1 == "set" then
		Maiks_ARdb.output[arg2] = arg3
	elseif arg1 == "get" then
		return Maiks_ARdb.output[arg2]
	end
end

function Maiks_AR:channel(arg1, arg2, arg3, arg4)
	if arg1 == "set" then
		Maiks_ARdb.options[arg2][arg3] = arg4
	elseif arg1 == "get" then
		return Maiks_ARdb.options[arg2][arg3]
	end
end

function Maiks_AR:CHAT_MSG(arg1, arg2, arg3, arg4, arg5)
--	print("1 "..arg1.."\n2 "..arg2.."\n3 "..arg3.."\n4 "..arg4.."\n5 "..arg5)
	_,_,str,_ = strsplit("_",arg1)
	for i = 1,50 do
		if Maiks_ARdb.input[i] == arg2 then
			if Maiks_ARdb.options[i][arg1] == true then
				s = {}
				s[1], sn = strsplit("\n", Maiks_ARdb.output[i], 2)
				SendChatMessage(s[1] , str, nil ,arg4)
				for x = 2,50 do
					if sn then
						s[x], sn = strsplit("\n", sn, 2)
						SendChatMessage(s[x] , str, nil ,arg4)
					end
				end
			elseif Maiks_ARdb.options[i][arg1] == nil then
				s = {}
				s[1], sn = strsplit("\n", Maiks_ARdb.output[i], 2)
				SendChatMessage(s[1], "WHISPER", nil ,arg3)
				for x = 2,50 do
					if sn then
						s[x], sn = strsplit("\n", sn, 2)
						SendChatMessage(s[x], "WHISPER", nil ,arg3)
					end
				end
			end
		end
	end
end 

function Maiks_AR:CHAT_MSG_BN_WHISPER(arg1, arg2, arg3, arg4, arg5)
print("1 "..arg1.."\n2 "..arg2.."\n3 "..arg3.."\n4 "..arg4.."\n5 "..arg5)
end 

ChatChannels = {
	["CHAT_MSG_SAY"] = "Say",
	["CHAT_MSG_WHISPER"] = "Whisper",
	["CHAT_MSG_YELL"] = "Yell",
	["CHAT_MSG_BATTLEGROUND"] = "Battleground",
	["CHAT_MSG_BATTLEGROUND_LEADER"] = "Battleground Leader",
	["CHAT_MSG_BN_WHISPER"] = "Real ID Whisper",
	["CHAT_MSG_CHANNEL"] = "Channels",
	["CHAT_MSG_GUILD"] = "Guild",
	["CHAT_MSG_OFFICER"] = "Guild Officer",
	["CHAT_MSG_PARTY"] = "Party",
	["CHAT_MSG_PARTY_LEADER"] = "Party Leader",
	["CHAT_MSG_RAID"] = "Raid",
	["CHAT_MSG_RAID_LEADER"] = "Raid Leader",
	["CHAT_MSG_RAID_WARNING"] = "Raid Warning",
}